Skip to main content

03-01 VBA-101

VBA 101​

This section focuses on the basics of opening the Visual Basic Editor (VBE) and starting with VBA. This is called VBA 101 because these are the steps that you have to know before you can start programming. Hopefully these steps are already done or you can work through them quickly.

There are multiple ways to open the VBE, including:

  • Use the keyboard shortcut ALT + F11
  • Use the button on the Developer tab of the Ribbon (if enabled) (TODO: include steps for how to enable this menu if needed)
  • Hit the Debug button if an existing code sample fails
  • Hit the edit button on the run macro button, again off the developer tab (also available with SHIFT+F11)

Of these, the first two are more common.

Several of these methods require the Developer tab to be showing. If you are working with VBA, you should enable it. To enable it, follow steps:

  1. XXX -- you need to go through the settings to Customize the Ribbon. TODO: add some steps and images for the Developer tab on the Ribbon

Once you have the VBE open, you can add or edit code for your spreadsheets. The basics of the simple program are included below.

TODO: add the steps for a Hello World... how to create Sub and output the text

TODO: add pictures for these steps too

This section of the book is one of the few where the steps will be so clearly specified. I am going to this level of detail to ensure that you are able to get things started. This book will not include such detailed steps later for how to type and run code.